package SqlDemo;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import static SqlDemo.user.getInstace;


public class Insert {
    public static void main(String[] args) {
        try {
            Connection con = getInstace();
            String sql = "insert into score(sno,cno,degree) value(?,?,?) ";
            PreparedStatement  p = con.prepareStatement(sql);
            p.setString(1,"13");
            p.setString(2,"46");
            p.setInt(3,46);
            int i = p.executeUpdate();
            System.out.println(i == 1?"成功":"不成功");
            con.close();
            p.close();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
